package d2_properties;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

/**
 * 目标：掌握把键值对数据存入到属性文件中去
 */
public class PropertiesTest2 {
    public static void main(String[] args) throws Exception {
        //1.创建一个Properties的对象出来，(键值对集合，空容器)
        Properties properties = new Properties();
        properties.setProperty("win","123");
        properties.setProperty("张三","152");
        properties.setProperty("莉莉丝","185");

        //2.把properties对象中的键值对数据存入到属性文件中去
        properties.store(new FileWriter("D:\\idea\\idea code\\java-practice\\practice\\properties-xml-log-app\\users2.properties")
                ,"我保存的数据");
    }
}
